/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dto;

import com.j256.ormlite.field.DataType;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import exceptions.EventException;
import java.util.ResourceBundle;

/**
 *
 * @author Sebastian
 */
@DatabaseTable(tableName = "video_event")
public class VideoEvent extends Event {
    
    public static final String VIDEO_TABLE_NAME = "video";
    
    private static final String VIDEO_EMPTY = "videoempty";
    
    @DatabaseField(columnName = VIDEO_TABLE_NAME, dataType = DataType.SERIALIZABLE)
    private Video video;

    public VideoEvent() {
        super();
    } // Needed for OrmLite
    
    public VideoEvent (Track track, String description, long timestamp, GeoPoint pos, Video video) throws EventException {
        super(track, description, timestamp, pos);
        
        setVideo(video);
    }
    
    
    public Video getVideo() {
        return video;
    }

    public void setVideo(Video video) {
        if (video == null) throw new IllegalArgumentException(ResourceBundle.getBundle("gui/guilabels").getString(VIDEO_EMPTY));
        this.video = video;
    }
    
}
